home *** CD-ROM | disk | FTP | other *** search
- /*
- File: Debug.h
-
- Contains: Assert/Debug stuff ripped of from the Finder.
-
- Written by: Tim Harnett
-
- Copyright: © 1994 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <2> 10/6/94 TMH added ASSERTNOERR
- <1> 9/21/94 TMH new, gotta have this stuff
- 9/21/94 TMH xxx put comment here xxx
-
- To Do:
- */
-
- #ifndef __Debug__
- #define __Debug__
-
- #ifndef __TYPES__
- #include "Types.h"
- #endif
-
- extern void dbgAssert(const char* filename, int line);
- extern void dbgAssertPrint(const char*, ...);
- void dbgAssertNoErr(const char* filename, int line,OSErr osErr);
-
-
- #define BLOCKASSERT(what) { if (!(what)) dbgAssert(__FILE__,__LINE__); }
- #define ASSERT(what) do BLOCKASSERT(what) while(0)
-
-
- #define BLOCKASSERTPRINT(what, args) { if (!(what)) { dbgAssertPrint args; } }
- #define ASSERTPRINT(what, args) do BLOCKASSERTPRINT(what, args) while (0)
-
-
- #define BLOCKASSERTNOERR(what) { if ((what)!=noErr) { dbgAssertNoErr(__FILE__,__LINE__,what); } }
- #define ASSERTNOERR(what) do BLOCKASSERTNOERR(what) while (0)
-
-
- #endif __Debug__
-